<HTML> 
<HEAD> 
	<TITLE>3rd Party ROBOTC Drivers</TITLE> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
</HEAD> 
 
<BODY bgcolor="#ffffff" link="#000000" vlink="#000000"> 
<table width="100%" bgcolor="navy" cellspacing=0 cellpadding=1 border=0> 
<tr><td><table width="100%" bgcolor="#EEEEDD" cellspacing=0 cellpadding=3 border=0> 
<tr> 
    <td width="33%" align="left"> <img src="images/LOGO_NXT.gif" width=266 height=44 border="0" alt="Mindstorms"></td> 
    <td><b><font size="+3" color="navy">3rd Party ROBOTC Drivers</font></b></td> 
    <td align="right"> <img src="images/logo.png" width=44 height=44 border="0" alt="RobotC"></td>     
</tr> 
  <tr bgcolor="#cccc99" align="right"> 
          <td colspan=3> <font face="arial" size="-1"> [<a href=main.html>Home</a>] [<a target=_top href="https://sourceforge.net/projects/rdpartyrobotcdr/">Download</a>] [<a target=_top href="http://apps.sourceforge.net/mantisbt/rdpartyrobotcdr/my_view_page.php">Submit a bug/suggestion</a>]  [<a target=_top href="http://www.robotc.net/forums/">ROBOTC Forums</a>] [<a target=_top href="http://botbench.com">Blog</a>] [<a target=_top href="http://sourceforge.net/donate/index.php?group_id=257238">Support this project</a>]</font> </td> 
</tr> 
</table></td></tr> 
</table> 
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
  <div class="summary">
<a href="#files">Files</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<h1>Energy Meter<br/>
<small>
[<a class="el" href="group__lego.html">Lego</a>]</small>
</h1>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="files"></a>
Files</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="lego-energymeter_8h.html">lego-energymeter.h</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>RobotC Energy Meter Driver. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__legoem.html#ga16a29ddb8a70e6dd107782a3891c0bcc">LEGOEM_I2C_ADDR</a>&#160;&#160;&#160;0x04</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__legoem.html#ga9f833da31149591faadb0dc98c8efc12">LEGOEM_I2C_REG</a>&#160;&#160;&#160;0x0A</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__legoem.html#ga083ce8d36b0fc2bb8b0ac6323f5f6aa2">LEGOEM_I2C_SIZE</a>&#160;&#160;&#160;14</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__legoem.html#ga536d57f34456e9686630d98447338506">LEGOEMreadData</a> (tSensors link, float &amp;voltageIn, float &amp;currentIn, float &amp;voltageOut, float &amp;currentOut, int &amp;joule, float &amp;wattIn, float &amp;wattOut)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__legoem.html#ga600bb1b598c21bf9cd7090eb23abcac1">LEGOEM_I2CRequest</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__legoem.html#ga06876496b5cfdf82d6f55ec2555fdb9a">LEGOEM_I2CReply</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Energy Meter </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga16a29ddb8a70e6dd107782a3891c0bcc"></a><!-- doxytag: member="lego&#45;energymeter.h::LEGOEM_I2C_ADDR" ref="ga16a29ddb8a70e6dd107782a3891c0bcc" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LEGOEM_I2C_ADDR&#160;&#160;&#160;0x04</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Energy Meter I2C device address </p>

<p>Definition at line <a class="el" href="lego-energymeter_8h_source.html#l00047">47</a> of file <a class="el" href="lego-energymeter_8h_source.html">lego-energymeter.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga9f833da31149591faadb0dc98c8efc12"></a><!-- doxytag: member="lego&#45;energymeter.h::LEGOEM_I2C_REG" ref="ga9f833da31149591faadb0dc98c8efc12" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LEGOEM_I2C_REG&#160;&#160;&#160;0x0A</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Start of I2C registers that need to be read </p>

<p>Definition at line <a class="el" href="lego-energymeter_8h_source.html#l00048">48</a> of file <a class="el" href="lego-energymeter_8h_source.html">lego-energymeter.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga083ce8d36b0fc2bb8b0ac6323f5f6aa2"></a><!-- doxytag: member="lego&#45;energymeter.h::LEGOEM_I2C_SIZE" ref="ga083ce8d36b0fc2bb8b0ac6323f5f6aa2" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LEGOEM_I2C_SIZE&#160;&#160;&#160;14</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Number of registers to read at once </p>

<p>Definition at line <a class="el" href="lego-energymeter_8h_source.html#l00049">49</a> of file <a class="el" href="lego-energymeter_8h_source.html">lego-energymeter.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga536d57f34456e9686630d98447338506"></a><!-- doxytag: member="lego&#45;energymeter.h::LEGOEMreadData" ref="ga536d57f34456e9686630d98447338506" args="(tSensors link, float &amp;voltageIn, float &amp;currentIn, float &amp;voltageOut, float &amp;currentOut, int &amp;joule, float &amp;wattIn, float &amp;wattOut)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool LEGOEMreadData </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float &amp;&#160;</td>
          <td class="paramname"> <em>voltageIn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float &amp;&#160;</td>
          <td class="paramname"> <em>currentIn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float &amp;&#160;</td>
          <td class="paramname"> <em>voltageOut</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float &amp;&#160;</td>
          <td class="paramname"> <em>currentOut</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"> <em>joule</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float &amp;&#160;</td>
          <td class="paramname"> <em>wattIn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float &amp;&#160;</td>
          <td class="paramname"> <em>wattOut</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read a snapshot of the current register values. They must all be read at once to ensure data coherency.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the LEGO Energy Meter port number </td></tr>
    <tr><td class="paramname">voltageIn</td><td>voltage level on input </td></tr>
    <tr><td class="paramname">currentIn</td><td>current supplied on input </td></tr>
    <tr><td class="paramname">voltageOut</td><td>voltage on output </td></tr>
    <tr><td class="paramname">currentOut</td><td>current drawn on output </td></tr>
    <tr><td class="paramname">joule</td><td>number of Joules stored on E-Meter </td></tr>
    <tr><td class="paramname">wattIn</td><td>amount of Watts coming in </td></tr>
    <tr><td class="paramname">wattOut</td><td>amount of Watts being consumed </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="lego-energymeter-test1_8c-example.html#a0">lego-energymeter-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="lego-energymeter_8h_source.html#l00078">78</a> of file <a class="el" href="lego-energymeter_8h_source.html">lego-energymeter.h</a>.</p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="ga06876496b5cfdf82d6f55ec2555fdb9a"></a><!-- doxytag: member="lego&#45;energymeter.h::LEGOEM_I2CReply" ref="ga06876496b5cfdf82d6f55ec2555fdb9a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> <a class="el" href="group__legoem.html#ga06876496b5cfdf82d6f55ec2555fdb9a">LEGOEM_I2CReply</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold I2C reply data </p>

<p>Definition at line <a class="el" href="lego-energymeter_8h_source.html#l00059">59</a> of file <a class="el" href="lego-energymeter_8h_source.html">lego-energymeter.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga600bb1b598c21bf9cd7090eb23abcac1"></a><!-- doxytag: member="lego&#45;energymeter.h::LEGOEM_I2CRequest" ref="ga600bb1b598c21bf9cd7090eb23abcac1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> <a class="el" href="group__legoem.html#ga600bb1b598c21bf9cd7090eb23abcac1">LEGOEM_I2CRequest</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold I2C command data </p>

<p>Definition at line <a class="el" href="lego-energymeter_8h_source.html#l00058">58</a> of file <a class="el" href="lego-energymeter_8h_source.html">lego-energymeter.h</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Mar 13 2013 19:56:44 for ROBOTC Drivers by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
